package com.yss.reportworld.domain.rule;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yss.common.core.annotation.EasyExcel;
import com.yss.common.core.annotation.ExcelValid;
import com.yss.common.core.utils.easyexecl.IntegerConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 数据集与参数或常量或函数关联对象 rw_db_r_dataset_par_func_relation
 *
 * @author yss
 * @date 2023-07-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("rw_db_r_dataset_par_func_relation")
public class RDatasetParFuncRelation extends Model<RDatasetParFuncRelation> {
    public static final String SHEET_NAME = "关联信息";
    /**
     * 主键
     */
    @ExcelIgnore
    @TableId("ID")
    private String id;

    @ExcelProperty({"关联信息", "校验对象"})
    @ExcelValid(message = "【关联信息】【关联信息】【校验对象】不能为空")
    private String checkCode;

    /**
     * 类型(1参数分类表;2常量分类表I;3函数表)
     */
    @ExcelProperty(value = {"关联信息", "分类"}, converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "0=参数分类,1=常量分类,2=函数")
    @TableField("TYPES")
    @ExcelValid(message = "【关联信息】【关联信息】【分类】不能为空")
    private Integer types;

    @ExcelProperty({"关联信息", "名称"})
    @ExcelValid(message = "【关联信息】【关联信息】【名称】不能为空")
    private String name;

    @ExcelProperty({"关联信息", "标题"})
    @ExcelValid(message = "【关联信息】【关联信息】【标题】不能为空")
    private String title;

    /**
     * 校验对象ID
     */
    @ExcelIgnore
    @TableField("OBJECT_ID")
    private String objectId;

    /**
     * 数据集ID
     */
    @ExcelIgnore
    @TableField("DATASET_ID")
    private String datasetId;

    /**
     * 参数分类表ID、常量分类表ID、函数表ID
     */
    @ExcelIgnore
    @TableField("RELATION_ID")
    private String relationId;
    /**
     * 数据编码
     */
    @ExcelIgnore
    @TableField("RW_DB_ID")
    private String rwDbId;

}
